import 'package:xin_nuo_pda/bean/app_update_entity.dart';

appUpdateEntityFromJson(AppUpdateEntity data, Map<String, dynamic> json) {
	if (json['records'] != null) {
		data.records = (json['records'] as List).map((v) => AppUpdateEntityBodyRecords().fromJson(v)).toList();
	}
	if (json['total'] != null) {
		data.total = json['total'] is String
				? int.tryParse(json['total'])
				: json['total'].toInt();
	}
	if (json['size'] != null) {
		data.size = json['size'] is String
				? int.tryParse(json['size'])
				: json['size'].toInt();
	}
	if (json['current'] != null) {
		data.current = json['current'] is String
				? int.tryParse(json['current'])
				: json['current'].toInt();
	}
	if (json['orders'] != null) {
		data.orders = (json['orders'] as List).map((v) => v).toList().cast<dynamic>();
	}
	if (json['hitCount'] != null) {
		data.hitCount = json['hitCount'];
	}
	if (json['searchCount'] != null) {
		data.searchCount = json['searchCount'];
	}
	if (json['pages'] != null) {
		data.pages = json['pages'] is String
				? int.tryParse(json['pages'])
				: json['pages'].toInt();
	}
	return data;
}

Map<String, dynamic> appUpdateEntityToJson(AppUpdateEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['records'] =  entity.records?.map((v) => v.toJson())?.toList();
	data['total'] = entity.total;
	data['size'] = entity.size;
	data['current'] = entity.current;
	data['orders'] = entity.orders;
	data['hitCount'] = entity.hitCount;
	data['searchCount'] = entity.searchCount;
	data['pages'] = entity.pages;
	return data;
}

appUpdateEntityBodyRecordsFromJson(AppUpdateEntityBodyRecords data, Map<String, dynamic> json) {
	if (json['RELEASE_DESC'] != null) {
		data.releaseDesc = json['RELEASE_DESC'].toString();
	}
	if (json['RELEASE_NO'] != null) {
		data.releaseNo = json['RELEASE_NO'].toString();
	}
	if (json['ID'] != null) {
		data.iD = json['ID'].toString();
	}
	if (json['SQL_SCRIPT_URL'] != null) {
		data.sqlScriptUrl = json['SQL_SCRIPT_URL'];
	}
	if (json['RESOURCE_URL'] != null) {
		data.resourceUrl = json['RESOURCE_URL'].toString();
	}
	if (json['RESOURCE_TYPE'] != null) {
		data.resourceType = json['RESOURCE_TYPE'].toString();
	}
	if (json['CREATE_TIME'] != null) {
		data.createTime = json['CREATE_TIME'].toString();
	}
	return data;
}

Map<String, dynamic> appUpdateEntityBodyRecordsToJson(AppUpdateEntityBodyRecords entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['RELEASE_DESC'] = entity.releaseDesc;
	data['RELEASE_NO'] = entity.releaseNo;
	data['ID'] = entity.iD;
	data['SQL_SCRIPT_URL'] = entity.sqlScriptUrl;
	data['RESOURCE_URL'] = entity.resourceUrl;
	data['RESOURCE_TYPE'] = entity.resourceType;
	data['CREATE_TIME'] = entity.createTime;
	return data;
}

appUpdateEntityResultFromJson(AppUpdateEntityResult data, Map<String, dynamic> json) {
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['message'] != null) {
		data.message = json['message'].toString();
	}
	return data;
}

Map<String, dynamic> appUpdateEntityResultToJson(AppUpdateEntityResult entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['code'] = entity.code;
	data['message'] = entity.message;
	return data;
}